USE [Musicman]
GO
/****** Object:  Table [dbo].[FilesStats]    Script Date: 11/16/2008 00:34:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FilesStats](
	[SearchFileID] [bigint] NOT NULL,
	[TotalDownloads] [int] NOT NULL CONSTRAINT [DF_FilesStats_TotalDownloads]  DEFAULT ((0)),
	[TotalVoted] [int] NOT NULL CONSTRAINT [DF_FilesStats_TotalVoted]  DEFAULT ((0)),
	[Rating] [decimal](18, 2) NOT NULL CONSTRAINT [DF_FilesStats_Rating]  DEFAULT ((0)),
 CONSTRAINT [PK_FilesStats] PRIMARY KEY CLUSTERED 
(
	[SearchFileID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
USE [Musicman]
GO
ALTER TABLE [dbo].[FilesStats]  WITH CHECK ADD  CONSTRAINT [FK_FilesStats_FilesStats] FOREIGN KEY([SearchFileID])
REFERENCES [dbo].[SearchFile] ([SearchFileID]) 